FROM python:3.13.1-slim-bullseye

LABEL maintainer="syx1026@qq.com"
ARG TZ='Asia/Shanghai'

RUN echo /etc/apt/sources.list
ENV BUILD_PREFIX=/app

ADD config.json ${BUILD_PREFIX}

RUN apt-get update \
    &&apt-get install -y --no-install-recommends bash libavcodec-extra git\
    && cd ${BUILD_PREFIX} && git clone https://gitee.com/lainyu/kqk_wechat.git \
    && pip install poetry && poetry install --no-dev

WORKDIR ${BUILD_PREFIX}

RUN mkdir -p /home/kqk && groupadd -r kqk && useradd -r -g kqk -s /bin/bash -d /home/kqk kqk \
    && chown -R kqk:kqk /home/kqk && chown -R kqk:kqk /app && chown -R kqk:kqk /app/data/

USER kqk

ENTRYPOINT ["/app/docker/entrypoint.sh"]
#CMD ["python", "main.py"]